package com.ronsai.umtrack.api;

import com.ronsai.umtrack.entity.Login;
import com.ronsai.umtrack.entity.Member;

import java.util.HashMap;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface ApiService {

    /**
     * 获取会员信息
     */
    @FormUrlEncoded
    @POST("member/getInfo")
    Observable<Member> getInfo(@Field("token") String token);

    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("/member/loginPwd")
    Observable<String> loginUser(@FieldMap HashMap<String, String> map);

    /**
     * 获取融云token
     */
    @FormUrlEncoded
    @POST("/member/getRongData")
    Observable<String> getRongToken(@FieldMap HashMap<String, String> map);

    /**
     * 刷新token
     */
    @FormUrlEncoded
    @POST("/member/getRongData")
    Observable<Login> refreshToken(@Field("refreshToken") String refreshToken);

    /**
     * 获取七牛上传token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("/member/getRongData")
    Observable<String> getQiniuUploadToken(@FieldMap HashMap<String, String> map);

    /**
     * 首页banner
     */
    @FormUrlEncoded
    @POST("/app/banner/ajaxList")
    Observable<Login> getHomeBannerList();

}
